import { createApp } from 'vue';
import pinia from '/@/stores/index';
import App from './App.vue';
import router from './router';
import { directive } from '/@/directive/index';
import { i18n } from '/@/i18n/index';
import other from '/@/utils/other';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import VueGridLayout from 'vue-grid-layout';
import { getUpFileUrl, handleTree, selectDictLabel, previewFile, parseTime,addDateRange } from '/@/utils/angis';
import { dictApi } from '/@/api/system/dict';
import pagination from '/@/components/pagination/index.vue';
import DictTag from '/@/components/DictTag/index.vue';
import TxtLink from '/@/components/TxtLink/index.vue';
import VxeUITable from 'vxe-table';
import 'vxe-table/lib/style.css';
import modal from '/@/utils/modal';
import { download } from '/@/utils/request'
import elementIcons from '/@/components/SvgIcon/svgicon.js'

const app = createApp(App);

directive(app);
other.elSvg(app);
app.component('pagination', pagination);
app.component('DictTag', DictTag);
app.component('TxtLink', TxtLink);

app.use(elementIcons);
app.use(VxeUITable).use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t }).use(i18n).use(VueGridLayout);
app.mount('#app');

app.config.globalProperties.previewFile = previewFile;
app.config.globalProperties.getUpFileUrl = getUpFileUrl;
app.config.globalProperties.handleTree = handleTree;
app.config.globalProperties.useDict = dictApi().useDict;
app.config.globalProperties.selectDictLabel = selectDictLabel;
app.config.globalProperties.parseTime = parseTime;
app.config.globalProperties.modal = modal;
app.config.globalProperties.download = download
app.config.globalProperties.addDateRange = addDateRange
